/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package src;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;


/**
 *
 * @author JMix
 */

public class CopiarArchivo {

    public CopiarArchivo(String rutaInicio, String rutaDestino) {
        try {
            File origen = new File(rutaInicio);
            File destino = new File(rutaDestino);
            FileOutputStream out;
            try (FileInputStream in = new FileInputStream(origen)) {
                out = new FileOutputStream(destino);
                int c;
                while( (c = in.read() ) != -1)
                        out.write(c);
            }
	    out.close();
	} catch(IOException e) {
            System.out.println("error copiando el archivo");
	}
    }
}